package hu.bme.mit.rifl.business.nodes;

import hu.bme.mit.rifl.business.base.RiflOrderQueue;
import hu.bme.mit.rifl.business.base.WFElement;

/**
 * The first node of the workflow. The test data assigned in the Coordinator is
 * getting served here first.
 */
public class SubmitOrder extends WFElement {

	/**
	 * Default constructor of the node. Sets the name (displayed on the GUI), the
	 * input queue(s) and the output queue(s).
	 */
	public SubmitOrder() {
		super("SubmitOrder");
		
		inputs.add(new RiflOrderQueue("rifl.new2submit"));
		outputs.add(new RiflOrderQueue("rifl.submit2ack"));
	}

	public static void main(String[] args) {
		SubmitOrder node = new SubmitOrder();
		node.run();
	}

	/**
	 * Business logic.
	 */
	public void process() {
		this.order.setState("NEW");
		this.order.setStateCodes(0);
	}
}